package String_demo;

public class StringEndsWith {
    public static void main(String[] args) {
        /**
         *  .endsWith():
         * 检查字符串的后缀;
         *
         * .startsWith():
         * 检查字符串的前缀;
         */
        String file1 = "游戏人生零.mp4";
        String file2 = "宫崎骏.jpg";
        System.out.println(file1.endsWith(".mp4"));
        System.out.println(file2.endsWith(".jpg"));

        String file3 = "天空之城.jpg";
        System.out.println(file3.startsWith("天"));



    }
}
